package yuan.deng;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Version: V1.0
 */
@RestController
public class HelloController {

    /*@Value("${name}")
    private String name;//直接注入值

    @Value("${citys[0]}")//数组注入
    private List city1;
    @Value("${citys[1]}")
    private List city2;

    @Autowired
    private Environment env;//调方法注入值
*/
    @Autowired
    private Person person;


    @RequestMapping("/hello")
    public String hello(){
        /*System.out.println(name);
        System.out.println(env.getProperty("person.age"));
        System.out.println(city1);
        System.out.println(city2);*/
        System.out.println(person.getName()+person.getAge());
        return "hellow world!!!!!!!!!!";
    }
}
